﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeOffsetSurface : OdGeSurface
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeOffsetSurface(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeOffsetSurface_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeOffsetSurface obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeOffsetSurface()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeOffsetSurface(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeOffsetSurface() : this(GlobalsPINVOKE.new_OdGeOffsetSurface__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeOffsetSurface(OdGeSurface baseSurface, double offsetDistance, bool makeCopy) : this(GlobalsPINVOKE.new_OdGeOffsetSurface__SWIG_1(OdGeSurface.getCPtr(baseSurface), offsetDistance, makeCopy), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeOffsetSurface(OdGeSurface baseSurface, double offsetDistance) : this(GlobalsPINVOKE.new_OdGeOffsetSurface__SWIG_2(OdGeSurface.getCPtr(baseSurface), offsetDistance), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeOffsetSurface(OdGeOffsetSurface source) : this(GlobalsPINVOKE.new_OdGeOffsetSurface__SWIG_3(OdGeOffsetSurface.getCPtr(source)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool isPlane()
		{
			bool result = GlobalsPINVOKE.OdGeOffsetSurface_isPlane(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isBoundedPlane()
		{
			bool result = GlobalsPINVOKE.OdGeOffsetSurface_isBoundedPlane(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isSphere()
		{
			bool result = GlobalsPINVOKE.OdGeOffsetSurface_isSphere(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isCylinder()
		{
			bool result = GlobalsPINVOKE.OdGeOffsetSurface_isCylinder(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isCone()
		{
			bool result = GlobalsPINVOKE.OdGeOffsetSurface_isCone(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isEllipCylinder()
		{
			bool result = GlobalsPINVOKE.OdGeOffsetSurface_isEllipCylinder(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isEllipCone()
		{
			bool result = GlobalsPINVOKE.OdGeOffsetSurface_isEllipCone(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isTorus()
		{
			bool result = GlobalsPINVOKE.OdGeOffsetSurface_isTorus(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool getSurface(OdGeSurface simpleSurface)
		{
			bool result = GlobalsPINVOKE.OdGeOffsetSurface_getSurface(this.swigCPtr, simpleSurface);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getConstructionSurface(OdGeSurface baseSurface)
		{
			GlobalsPINVOKE.OdGeOffsetSurface_getConstructionSurface(this.swigCPtr, baseSurface);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double offsetDist()
		{
			double result = GlobalsPINVOKE.OdGeOffsetSurface_offsetDist(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeOffsetSurface set(OdGeSurface baseSurface, double offsetDistance, bool makeCopy)
		{
			OdGeOffsetSurface result = new OdGeOffsetSurface(GlobalsPINVOKE.OdGeOffsetSurface_set__SWIG_0(this.swigCPtr, OdGeSurface.getCPtr(baseSurface), offsetDistance, makeCopy), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeOffsetSurface set(OdGeSurface baseSurface, double offsetDistance)
		{
			OdGeOffsetSurface result = new OdGeOffsetSurface(GlobalsPINVOKE.OdGeOffsetSurface_set__SWIG_1(this.swigCPtr, OdGeSurface.getCPtr(baseSurface), offsetDistance), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeOffsetSurface Assign(OdGeOffsetSurface surface)
		{
			OdGeOffsetSurface result = new OdGeOffsetSurface(GlobalsPINVOKE.OdGeOffsetSurface_Assign(this.swigCPtr, OdGeOffsetSurface.getCPtr(surface)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
